/**********************************************************************/
#ifndef MAINFRAME_H
#define MAINFRAME_H

/**********************************************************************/
#include <QtGui/QMainWindow>

/**********************************************************************/
#define VERSION_MAJOR "0"
#define VERSION_MINOR "1"
#define VERSION_REVISION "0"

#define PROGRAM_NAME "Simple Chat Server"
#define PROGRAM_VERSION VERSION_MAJOR "." VERSION_MINOR "." \
                        VERSION_REVISION

#define ABOUT_TEXT "<b>" PROGRAM_NAME " " PROGRAM_VERSION "</b>" \
                   "<br /><br />Based on QT " QT_VERSION_STR "\n" \
                   "<br /><br />Compiled on " __DATE__ " at " __TIME__ \
                   "<br /><br />Licensed under GNU GPL v3" \
                   "<br /><br />This is a QT implementation of a " \
                   "chatserver that makes use of a xml based chat " \
                   "protocol."

#define DEFAULT_PORT 1025
#define DEFAULT_STATUSBAR_TIMEOUT 7000

/**********************************************************************/
namespace Ui
{
  class MainFrame;
}

/**********************************************************************/
class MainFrame : public QMainWindow
{
  Q_OBJECT

  public:
    MainFrame(QWidget *parent = 0);

  public slots:
    void displayError(QString);
    void printProtocolMessage(QString);
    void addUser(QString);
    void displayStatusMessage(QString);

  private:
    Ui::MainFrame *ui;
    quint16 port;

  private slots:
    void on_menuHelpAboutQT_triggered();
    void on_menuHelpAbout_triggered();
    void on_menuFileExit_triggered();
    void on_menuServerSettings_triggered();
    void on_menuServerStop_triggered();
    void on_menuServerStart_triggered();

  signals:
    void startServer(quint16);
    void stopServer();
};

/**********************************************************************/
#endif // MAINFRAME_H
